package mutsumimod.cards.custom;

import com.megacrit.cardcrawl.actions.utility.DiscardToHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.actions.CustomDrawPileToHandAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;

public class ReplaceFight extends BaseCard {
    public static final String ID = makeID(ReplaceFight.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.COMMON,
            CardTarget.ENEMY,
            0
    );

    public ReplaceFight() {
        super(ID, info);
        setAttr(4,0,0);
        setAttrUpg(2,0,0);
    }

    @Override
    public void onTriggerStand(int amount) {
        if(AbstractDungeon.player.drawPile.contains(this)){
            addToTop(new CustomDrawPileToHandAction(this));
        }
        if(AbstractDungeon.player.discardPile.contains(this)){
            addToTop(new DiscardToHandAction(this));
        }
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        damageMonster(m);
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new ReplaceFight();
    }
}
